# app/utils.py（辅助工具）

from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.backends import default_backend

def load_private_key(filepath):
    with open(filepath, "rb") as key_file:
        return serialization.load_pem_private_key(key_file.read(), password=None, backend=default_backend())

def load_public_key(filepath):
    with open(filepath, "rb") as key_file:
        return serialization.load_pem_public_key(key_file.read(), backend=default_backend())
